package re.jf.echangeur.ihm;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.ParseException;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JSeparator;
import javax.swing.SwingUtilities;
import javax.swing.UnsupportedLookAndFeelException;

import de.javasoft.plaf.synthetica.SyntheticaBlackMoonLookAndFeel;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class MainApp extends javax.swing.JFrame {

  /**
   * 
   */
  private static final long serialVersionUID = 47896838145069530L;

  /**
   * Auto-generated main method to display this JFrame
   */
  public static void main(String[] args) {
    try {
      javax.swing.UIManager.setLookAndFeel(new SyntheticaBlackMoonLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
      e.printStackTrace();
    } catch (ParseException e) {
      e.printStackTrace();
    }

    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        MainApp inst = new MainApp();
        inst.setLocationRelativeTo(null);
        inst.setVisible(true);
      }
    });
  }

  private JMenuItem helpMenuItem;
  private JMenu jMenu5;
  private JMenuItem deleteMenuItem;
  private JSeparator jSeparator1;
  private JMenuItem pasteMenuItem;
  private JMenuItem copyMenuItem;
  private JMenuItem cutMenuItem;
  private JMenu jMenu4;
  private JMenuItem exitMenuItem;
  private JSeparator jSeparator2;
  private JMenuItem closeFileMenuItem;
  private JMenuItem saveAsMenuItem;
  private JMenuItem saveMenuItem;
  private JMenuItem openFileMenuItem;
  private JMenuItem newFileMenuItem;
  private JMenu jMenu3;

  private JMenuBar jMenuBar1;

  public MainApp() {
    super();
    initGUI();
  }

  private void initGUI() {
    try {
      setSize(400, 300);
      {
        jMenuBar1 = new JMenuBar();
        setJMenuBar(jMenuBar1);
        {
          jMenu3 = new JMenu();
          jMenuBar1.add(jMenu3);
          jMenu3.setText("Fichier");
          {
            newFileMenuItem = new JMenuItem();
            jMenu3.add(newFileMenuItem);
            newFileMenuItem.setText("Créer fichier");
            newFileMenuItem.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent evt) {
                newFileMenuItemActionPerformed(evt);
              }
            });
          }
          {
            openFileMenuItem = new JMenuItem();
            jMenu3.add(openFileMenuItem);
            openFileMenuItem.setText("Comparer fichier");
            openFileMenuItem.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent evt) {
                comparerFichierMenuItemActionPerformed(evt);
              }
            });
          }
          {
            saveMenuItem = new JMenuItem();
            jMenu3.add(saveMenuItem);
            saveMenuItem.setText("Enregistre");
          }
          {
            saveAsMenuItem = new JMenuItem();
            jMenu3.add(saveAsMenuItem);
            saveAsMenuItem.setText("Enregistrer sous ...");
          }
          {
            closeFileMenuItem = new JMenuItem();
            jMenu3.add(closeFileMenuItem);
            closeFileMenuItem.setText("Fermer");
          }
          {
            jSeparator2 = new JSeparator();
            jMenu3.add(jSeparator2);
          }
          {
            exitMenuItem = new JMenuItem();
            jMenu3.add(exitMenuItem);
            exitMenuItem.setText("Quitter");
          }
        }
        {
          jMenu4 = new JMenu();
          jMenuBar1.add(jMenu4);
          jMenu4.setText("Edition");
          {
            cutMenuItem = new JMenuItem();
            jMenu4.add(cutMenuItem);
            cutMenuItem.setText("Couper");
          }
          {
            copyMenuItem = new JMenuItem();
            jMenu4.add(copyMenuItem);
            copyMenuItem.setText("Copier");
          }
          {
            pasteMenuItem = new JMenuItem();
            jMenu4.add(pasteMenuItem);
            pasteMenuItem.setText("Coller");
          }
          {
            jSeparator1 = new JSeparator();
            jMenu4.add(jSeparator1);
          }
          {
            deleteMenuItem = new JMenuItem();
            jMenu4.add(deleteMenuItem);
            deleteMenuItem.setText("Supprimer");
          }
        }
        {
          jMenu5 = new JMenu();
          jMenuBar1.add(jMenu5);
          jMenu5.setText("Aide");
          {
            helpMenuItem = new JMenuItem();
            jMenu5.add(helpMenuItem);
            helpMenuItem.setText("Aide");
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  private void newFileMenuItemActionPerformed(ActionEvent evt) {
    System.out.println("newFileMenuItem.actionPerformed, event=" + evt);
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        NewJFrame inst = new NewJFrame();
        inst.setLocationRelativeTo(null);
        inst.setVisible(true);
      }
    });

  }

  private void comparerFichierMenuItemActionPerformed(ActionEvent evt) {
    System.out.println("openFileMenuItem.actionPerformed, event=" + evt);
    ComparerFichierJFrame inst = new ComparerFichierJFrame();
    inst.setLocationRelativeTo(null);
    inst.setVisible(true);
    inst.setAlwaysOnTop(true);
    inst.setParent(MainApp.this);
  }

}
